package com.zzyl.job;

import com.xxl.job.core.handler.annotation.XxlJob;
import com.zzyl.service.ReservationService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

/**
 * @author itheima
 */
@Component
@Slf4j
@RequiredArgsConstructor
public class ReservationJob {

    private final ReservationService reservationService;

    @XxlJob("reservationStatusToExpired")
    public void ReservationJobUpdateStatus(){
        LocalDateTime now = LocalDateTime.now();
        reservationService.updateReservationStatus(now);
    }
}
